package org.TCC_NOVO.client.visual;

import com.gwtext.client.widgets.Button;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.Window;
import com.gwtext.client.widgets.form.FormPanel;
import com.gwtext.client.widgets.form.TextField;

public class LoginForm extends Window/* Panel*/{

    public Panel panelPrin = new Panel();
    public FormPanel formPanel = new FormPanel();
    public TextField fName = null;
    public TextField fpassWord = null;
    public Button loginButton = null;

    public LoginForm() {
        this.init();
    }

    private void init(){

        this.setTitle("Login");
        panelPrin.setBorder(false);
        panelPrin.setPaddings(1);

        formPanel.setFrame(true);        
        formPanel.setWidth(350);
        formPanel.setLabelWidth(75);
        fName = new TextField("Login", "userName", 230);
        fName.setAllowBlank(true);
        fName.setBlankText("Este campo é obrigatório");
        fName.focus();
        formPanel.add(fName);
        fpassWord = new TextField("Senha", "pswd", 230);
        fpassWord.setInputType("password");
        formPanel.add(fpassWord);
        
        loginButton = new Button("Login");
        loginButton.setIcon("Images/login.png");
        loginButton.setTooltip("Permite efetuar o login no sistema");
        formPanel.addButton(loginButton);
        panelPrin.add(formPanel);
        
        this.add(panelPrin);
    }    

}
